import React, { Component, lazy, Suspense } from 'react';
import { Switch, Route, Redirect } from "react-router-dom"
import Tabbarx from '../../components/Tabbra';

//路由懒加载
var Home = lazy(() => import("./Home/Myhome"))
var Classification = lazy(() => import("./C/Classification"))
var Cateshopp = lazy(() => import("./My/Cateshopp"))
var Minecenter = lazy(() => import("./Min/Minecenter"))

interface Props {
    history: any,
    location: any,
    match: any
}
class Index extends Component<Props> {
    render() {
console.log(666);

        return (
            <div className='index'>

                <Suspense>
                    <Switch>
                        <Route exact path="/index/home" component={Home} />
                        <Route exact path="/index/classification" component={Classification} />
                        <Route exact path="/index/cateshopp" component={Cateshopp} />
                        <Route exact path="/index/minecenter" component={Minecenter} />
                        <Redirect exact from='/index' to="/index/home" />
                    </Switch>
                </Suspense>
                {/* Tabbar组件 */}
                <Tabbarx></Tabbarx>
            </div>
        );
    }
}

export default Index;